import {Component, OnInit} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {StarService} from '../star.service';

@Component({
  selector: 'app-star-level-rule-detail',
  templateUrl: './star-level-rule-detail.component.html',
  styleUrls: ['./star-level-rule-detail.component.css']
})
export class StarLevelRuleDetailComponent implements OnInit {
  private id: string;
  public starLevelRuleInfo: any = {};//starLevelRule信息

  constructor(private starService: StarService, private route: ActivatedRoute, private router: Router) {
  }

  ngOnInit() {
    this.id = this.route.snapshot.params.id;//获取参数
    this.loadStarLevelRuleInfo();//查询starLevelRule类型列表
  }

  /**
   * 查询starLevelRule信息
   */
  loadStarLevelRuleInfo() {
    this.starService.loadStarLevelRule(this.id).then((data: any) => {
      if (data) this.starLevelRuleInfo = data;
    })
  }

}
